﻿namespace KingerRobot.MexicoSailunMDC.SpiService;

internal interface IWcsAsrsCrnOutPut
{
    /// <summary>
    /// 查询所有出库路线
    /// </summary>
    /// <returns></returns>
    List<POWcsAsrsCrnOutput> GetWcsAsrsCrnOutputs();

    List<POWcsAsrsCrnOutput> GetWcsAsrsCrnAbnormalOutputsByCrnId(long crnId);

    List<POWcsAsrsCrnOutput> GetWcsAsrsCrnOutputsByCrnId(long crnId);
    /// <summary>
    /// 出库无货站台位
    /// </summary>
    /// <param name="crnIds"></param>
    /// <returns></returns>
    List<CrnOutLoc> GetNoSkuLoc(List<long?> crnIds);

    /// <summary>
    /// 出库所有站台位
    /// </summary>
    /// <param name="crnIds"></param>
    /// <returns></returns>
    List<CrnOutLoc> GetAllOutLoc(List<long?> crnIds);

    /// <summary>
    /// 通过站台位获取
    /// </summary>
    /// <param name="outPutLocId">出库站台为</param>
    /// <returns></returns>
    POWcsAsrsCrnOutput GetAsrsCrnOutputByOutPutLocId(long outPutLocId);
    /// <summary>
    /// 根据堆垛机获取堆垛机出库站台[包含正常出库站台为；包含异常口]
    /// </summary>
    /// <param name="crnId">堆垛机</param>
    /// <returns></returns>
    List<POWcsAsrsCrnOutput> GetWcsAsrsCrnOutputALLByEquipId(long crnId);
    /// <summary>
    /// 根据堆垛机获取堆垛机正常放胎位
    /// </summary>
    /// <param name="crnId"></param>
    /// <returns></returns>
    List<POWcsAsrsCrnOutput> GetWcsAsrsCrnOutputByEquipId(long crnId);
}

public class CrnOutLoc
{
    /// <summary>
    /// 堆垛机
    /// </summary>
    public long? CrnId { get; set; }
    /// <summary>
    /// 区域
    /// </summary>
    public long? AreaId { get; set; }
    /// <summary>
    /// 限制数量
    /// </summary>
    public int TaskCount { get; set; }
    /// <summary>
    /// 当前出库任务数
    /// </summary>
    public int NowCount { get; set; }
    /// <summary>
    /// 负责站台为
    /// </summary>
    public List<ExLocInfo> ExLocInfos { get; set; }
}
public class ExLocInfo
{
    /// <summary>
    /// 站台位位置ID
    /// </summary>
    public long? LocId { get; set; }
    public bool HasGood { get; set; }
    public int Index { get; set; }
}
